package com.sti.framework.models.User.data;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sti.framework.core.data.AbstractAuditingEntity;
import com.sti.framework.models.System.data.MenuManage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.List;

/**
 * user 角色表
 *
 *
 * enty 实物
 *
 * @author LYY
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName(value = "user_role", autoResultMap = true)
@ApiModel(value = "user_role", description = "角色信息")
public class Role extends AbstractAuditingEntity {

    /**
     * 角色名称
     */
    @ApiModelProperty(value = "角色名称", required = true, example = "这里是角色名称")
    @NotBlank(message = "请输入角色名称")
    @Size(min = 2,max = 20,message = "角色名称2-20个字")
    @TableField(value = "name")
    private String name;

    @TableField(exist = false)
    private List<MenuManage> menuManageList;
}
